<template>
  <div class="container">
    <el-row class="menu_page">
      <el-col>
        <el-menu mode="vertical" background-color="#ffffff" text-color="#000000" active-text-color="#e72f2f" class="el-menu-vertical-demo">
          <router-link to="/home">
            <el-menu-item index="0">
              <i class="fa fa-margin fa-map-marker"></i>
              <span slot="title">首页</span>
            </el-menu-item>
          </router-link>
          <!-- 		<router-link to="/user">
                <el-menu-item index="0">
                  <i class="fa fa-margin fa-map-marker"></i>
                  <span slot="title">党员信息管理</span>
                </el-menu-item>
              </router-link> -->
          <template v-for="item in items">
            <el-submenu v-if="item.children" :index="item.path" :key="item.path">
              <template slot="title">
                <i :class="'fa fa-margin ' + item.icon"></i>
                <span slot="title">{{ item.name }}</span>
              </template>
              <router-link v-for="(citem, cindex) in item.children" :to="citem.path" :key="cindex">
                <el-menu-item :index="citem.path">
                  <span slot="title">{{ citem.name }}</span>
                </el-menu-item>
              </router-link>
            </el-submenu>
          </template>
        </el-menu>
      </el-col>
    </el-row>
  </div>
</template>
<script>
export default {
  name: "leftmenu",
  data() {
    return {
      items: [
        {
          icon: "fa-sitemap",
          name:"公告中心",
          path: "announcement",
          children: [
            {
              path: "announcement",
              name: "公告管理"
            }
          ]
        },
        {
          icon: "fa-id-card",
          name: "党员信息",
          path:"user", 
          children: [{path: "user", name: "党员信息管理"}],
        },
        {
          icon: "fa-calendar-plus-o",
          name: "党建活动",
          path: "activity",
          children: [{path: "activity", name: "党建活动管理"}],
        },
        {
          icon: "fa-folder",
          name: "学习资料库",
          path: "info",
          children: [{path: "learningdatas", name: "学习资料管理"}],
        },
        {
          icon: "fa-wechat",
          name: "互动交流平台",
          path: "chat",
          children: [{path: "forum", name: "党建论坛"}],
        },
        {
          icon: "fa-user",
          name:"评审管理",
          path: "check",
          children: [
            {path: "learningdatascheck",name: "学习资料审核"},
            {path: "announcementcheck",name:"公告审核"},
            {path: "activitycheck",name: "活动审核"},
            {path: "formcheck",name:"论坛审核"}
          ]
        }
      ],
    };
  },
};
</script>
<style scoped>
.container{
  border-right: 1px solid #f0f0f0;
  box-sizing: border-box;
}
.menu_page {
  position: fixed;
  top: 71px;
  left: 0;
  /* min-height: 100%; */
  min-height: 100%;
  background-color: #ffffff;
  z-index: 99;
  width: 180px;
}

.el-menu {
  border: none;
}

.fa-margin {
  margin-right: 5px;
}

.el-menu-vertical-demo:not(.el-menu--collapse) {
  width: 180px;
  min-height: 400px;
}

.el-menu-vertical-demo {
  width: 35px;
}

.el-submenu .el-menu-item {
  min-width: 180px;
}

.hiddenDropdown,
.hiddenDropname {
  display: none;
}

a {
  text-decoration: none;
}
</style>
